<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>7.通过AFTER伪元素清除浮动影响</title>
  <style>
    div {
      width: 100px;
      height: 100px;
    }

    main {
      border: solid 3px black;
      width: 620px;
      margin: 0 auto;
      padding: 20px;

    }

    
    main::after {
      clear: both;
      content:"";
      display: block;
    }

    div.red {
      border: solid 2px red;
      float: left;
    }

    div.green {
      border: solid 2px green;
      float: left;
    }

    div.blue {
      border: solid 2px blue;
      float: left;

    }
  </style>
</head>

<body>
  <main>
    <div class="red"></div>
    <div class="green"></div>
    <div class="blue"></div>
  </main>
</body>

</html>